#include "Timestamp.h"
#include "Streams.h"

using namespace esda;

int main(int argc, char **argv)
{
	string databaseName("demo.db");
	string streamName1("demo_stream_1"), streamName2("demo_stream_2");
	
	SQLiteStream<double> stream1(databaseName, streamName1);
	SQLiteStream<string> stream2(databaseName, streamName2);
	
	Timestamp    t;
	
	stream1.set(t, 4.3);
	stream2.set(t, "s4.3");
	
	t = Timestamp::createAsInt();

	stream1.set(t, 4.5);
	stream2.set(t, "s4.5");
	
	t = Timestamp::createAsInt();
	
	stream1.set(t, 4.6);
	stream2.set(t, "s4.6");
	
	t = Timestamp::createAsInt();
	
	stream1.set(t, 4.7);
	stream2.set(t, "s4.7");
	
	t = Timestamp::createAsInt();
	
	stream1.set(t, 4.8);
	stream2.set(t, "s4.8");
	
	DEBUG("stream1.getFirstStart() = " << stream1.getFirstStart());
	DEBUG("stream1.getLastEnd() = " << stream1.getLastEnd());
	
	DEBUG("stream1.get() = " << stream1.get(t));
	
	DEBUG("stream2.getFirstStart() = " << stream2.getFirstStart());
	DEBUG("stream2.getLastEnd() = " << stream2.getLastEnd());
	
	DEBUG("stream2.get() = " << stream2.get(t));
	
	return 0;
}
